home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 266_01 / fonts.doc < prev    next >
Text File  |  1990-02-21  |  2KB  |  52 lines

  1.                     micro PLOX Fonts
  2.  
  3. The micro PLOX fonts are simple bit-mapped fonts where a string of bits
  4. in memory represents which bits in a given size rectangular area are to
  5. be turned on to form a character.  These fonts were designed foremost
  6. to use little memory.  The encoding scheme was empirically developed
  7. to be encoded fairly easily on sight and decoded with a simple loop.
  8.  
  9. Font 1 fits in a 3 wide by 5 high pixel area using 15 bits which fits
  10. nicely in a 16-bit int.
  11.  
  12.     12  13  14    The bits are decoded in the order shown at left.
  13.      9  10  11    Since each row is 3 bits they are conveniently
  14.      6   7   8    encoded as octal digits where the leftmost bit
  15.      3   4   5    has a value of 1, the middle one 2 and the right
  16.      0   1   2    one 4.
  17.  
  18.  XX   3   For example, the numeral one is shaped as shown by the
  19.   X   2   X's and the octal digit value of each row is shown
  20.   X   2   beside the row.  The code for the numeral one (ASCII 31)
  21.   X   2   then is 032227 where the leading zero denotes octal.
  22.  XXX  7
  23.  
  24. Fifteen bits does not give enough resolution for lower case letters
  25. so only the upper case and standard punctuation symbols from ASCII 0x20,
  26. space, through ASCII 0x5F, the underline, are encoded.
  27.  
  28. Font 2 was designed to fit in a 5 by 6 area using only 30 bits which
  29. can be encoded by two 16-bit ints.
  30.  
  31.  2  5  8 11 14   This is most conveniently thought of as two 5 by 3
  32.  1  4  7 10 13   areas, one on top of the other.  Now each column of
  33.  0  3  6  9 12   3 bits can be represented by an octal digit where
  34.  -------------   the bottom bit of a column has a value of one and
  35.  2  5  8 11 14   the top bit has a value of 4.
  36.  1  4  7 10 13
  37.  0  3  6  9 12
  38.  
  39.  75552
  40.  XXXX      If the uppercase B is to be displayed by a pattern
  41.  X   X     like the X's at left then the octal digits are as
  42.  XXXX      shown above and below.  These would be encoded in the
  43.  X   X     font 2 list as 061117,025557 since each character is
  44.  X   X     built from the lower left corner up and then right.
  45.  XXXX
  46.  71116
  47.  
  48. The decoding consists of getting a copy of the int(s) representing
  49. the character in the font and looping to: check each low order bit,
  50. turn on the equivalent pixel if the bit is one, and then shift off
  51. the bit just checked to put the next bit in the low order position.
  52.